<template>
  <div class="tasklist-dialog">
    <el-form
      :model="dataForm"
      :rules="dataRule"
      ref="dataForm"
      @keyup.enter.native="dataFormSubmit()"
      label-width="80px"
      class="form-container"
    >
      <el-row>
        <el-col :span="8">
          <el-form-item label="任务编号" label-width="120px" prop="taskNo">
            <el-input
              v-model="dataForm.taskNo"
              disabled
              placeholder="任务编号"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="规则组编号" label-width="120px" prop="rulesCode">
            <el-input
              v-model="dataForm.ruleCode"
              disabled
              placeholder="规则组编号"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="规则组名称" label-width="120px" prop="rulesName">
            <el-input
              v-model="dataForm.ruleName"
              placeholder="规则组名称"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div class="contain">
      <div class="table-title">
        <div class="left">
          <div class="redline"></div>
          <p>版本：未发布版本</p>
        </div>
        <div class="right">
          <el-button type="info" plain size="mini" @click="toruleupdate()"
            >解决冲突</el-button
          >
        </div>
      </div>
      <el-table :data="tableDatas" style="width: 100%; margin-top: 10px">
        <el-table-column
          v-for="(col, i) in conditionList"
          :property="col.decisionCode"
          :key="col.decisionCode"
          :index="i"
          :label="col.conditionDesc"
        >
          {{ col.conditionDesc }}
        </el-table-column>
      </el-table>
      <div class="table-title">
        <div class="left">
          <div class="redline"></div>
          <p>版本：生产版本</p>
        </div>
        <div class="right">
          <el-button type="info" plain size="mini">复制规则</el-button>
        </div>
      </div>
      <el-table :data="tableDatas" style="width: 100%; margin-top: 10px">
        <el-table-column
          v-for="(col, i) in prodconditionList"
          :property="col.decisionCode"
          :key="col.decisionCode"
          :index="i"
          :label="col.conditionDesc"
        >
          {{ col.conditionDesc }}
        </el-table-column>
      </el-table>
      <div class="table-title">
        <div class="left">
          <div class="redline"></div>
          <p>版本：版本1.03</p>
        </div>
        <div class="right">
          <el-button type="info" plain size="mini">复制规则</el-button>
        </div>
      </div>
      <el-table :data="tableDatas" style="width: 100%; margin-top: 10px">
        <el-table-column
          v-for="(col, i) in editionList"
          :property="col.decisionCode"
          :key="col.decisionCode"
          :index="i"
          :label="col.conditionDesc"
        >
          {{ col.conditionDesc }}
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dataForm: {
        id: 0,
        groupIdentify: null,
        ruleName: "",
        ruleDesc: "",
        ruleCode: "",
        remark: "",
        isEffect: "1",
      },
      dataRule: {
        ruleName: [
          { required: true, message: "规则名称不能为空", trigger: "blur" },
          { max: 50, message: "长度不能大于50", trigger: "blur" },
        ],
        groupIdentify: [
          { required: true, message: "所属规则组不能为空", trigger: "change" },
        ],
      },
      tableDatas: [],
      conditionList: [
        {
          conditionDesc: "赔案信息 的 赔案号 等于 56 ",
          conditionExpression: "$claim.getClmnum()==56",
          conditionMethodType: "",
          conditionType: "3",
          creTime: "2021-05-21T05:22:37.000+0000",
          creUserId: null,
          decisionCode: "D0001",
          divisorId: null,
          groupIdentify: "G00052",
          headType: "2",
          id: 45,
          isEffect: "1",
          lastUpdateId: null,
          lastUpdateTime: "2021-05-21T05:22:50.000+0000",
          leftEntityId: null,
          leftProperty: null,
          methodName: "",
          methodParams: "",
          remark:
            '[{"k":"赔案信息 的","v":"$claim."},{"k":"赔案号","v":"getClmnum()"},{"k":"等于","v":"=="},{"k":"56","v":"56"}]',
        },
        {
          conditionDesc: "赔案信息 的 赔案号 等于 56 ",
          conditionExpression: "$claim.getClmnum()==56",
          conditionMethodType: "",
          conditionType: "3",
          creTime: "2021-05-21T05:22:37.000+0000",
          creUserId: null,
          decisionCode: "D0002",
          divisorId: null,
          groupIdentify: "G00052",
          headType: "2",
          id: 46,
          isEffect: "1",
          lastUpdateId: null,
          lastUpdateTime: "2021-05-21T05:22:50.000+0000",
          leftEntityId: null,
          leftProperty: null,
          methodName: "",
          methodParams: "",
          remark:
            '[{"k":"赔案信息 的","v":"$claim."},{"k":"赔案号","v":"getClmnum()"},{"k":"等于","v":"=="},{"k":"56","v":"56"}]',
        },
      ], //表头信息
      prodconditionList: [
        {
          conditionDesc: "赔案信息 的 赔案号 等于 56 ",
          conditionExpression: "$claim.getClmnum()==56",
          conditionMethodType: "",
          conditionType: "3",
          creTime: "2021-05-21T05:22:37.000+0000",
          creUserId: null,
          decisionCode: "D0001",
          divisorId: null,
          groupIdentify: "G00052",
          headType: "2",
          id: 45,
          isEffect: "1",
          lastUpdateId: null,
          lastUpdateTime: "2021-05-21T05:22:50.000+0000",
          leftEntityId: null,
          leftProperty: null,
          methodName: "",
          methodParams: "",
          remark:
            '[{"k":"赔案信息 的","v":"$claim."},{"k":"赔案号","v":"getClmnum()"},{"k":"等于","v":"=="},{"k":"56","v":"56"}]',
        },
        {
          conditionDesc: "赔案信息 的 赔案号 等于 56 ",
          conditionExpression: "$claim.getClmnum()==56",
          conditionMethodType: "",
          conditionType: "3",
          creTime: "2021-05-21T05:22:37.000+0000",
          creUserId: null,
          decisionCode: "D0002",
          divisorId: null,
          groupIdentify: "G00052",
          headType: "2",
          id: 46,
          isEffect: "1",
          lastUpdateId: null,
          lastUpdateTime: "2021-05-21T05:22:50.000+0000",
          leftEntityId: null,
          leftProperty: null,
          methodName: "",
          methodParams: "",
          remark:
            '[{"k":"赔案信息 的","v":"$claim."},{"k":"赔案号","v":"getClmnum()"},{"k":"等于","v":"=="},{"k":"56","v":"56"}]',
        },
      ],
      editionList: [
        {
          conditionDesc: "赔案信息 的 赔案号 等于 56 ",
          conditionExpression: "$claim.getClmnum()==56",
          conditionMethodType: "",
          conditionType: "3",
          creTime: "2021-05-21T05:22:37.000+0000",
          creUserId: null,
          decisionCode: "D0001",
          divisorId: null,
          groupIdentify: "G00052",
          headType: "2",
          id: 45,
          isEffect: "1",
          lastUpdateId: null,
          lastUpdateTime: "2021-05-21T05:22:50.000+0000",
          leftEntityId: null,
          leftProperty: null,
          methodName: "",
          methodParams: "",
          remark:
            '[{"k":"赔案信息 的","v":"$claim."},{"k":"赔案号","v":"getClmnum()"},{"k":"等于","v":"=="},{"k":"56","v":"56"}]',
        },
        {
          conditionDesc: "赔案信息 的 赔案号 等于 56 ",
          conditionExpression: "$claim.getClmnum()==56",
          conditionMethodType: "",
          conditionType: "3",
          creTime: "2021-05-21T05:22:37.000+0000",
          creUserId: null,
          decisionCode: "D0002",
          divisorId: null,
          groupIdentify: "G00052",
          headType: "2",
          id: 46,
          isEffect: "1",
          lastUpdateId: null,
          lastUpdateTime: "2021-05-21T05:22:50.000+0000",
          leftEntityId: null,
          leftProperty: null,
          methodName: "",
          methodParams: "",
          remark:
            '[{"k":"赔案信息 的","v":"$claim."},{"k":"赔案号","v":"getClmnum()"},{"k":"等于","v":"=="},{"k":"56","v":"56"}]',
        },
      ],
    };
  },
  methods: {
    delcol(data, col) {},
    toruleupdate() {
      // console.log("222");
      this.$router.push({ path: "/drools-version/conflict-resolve/" + this.dataForm.id });
    },
  },
};
</script>

<style lang="less">
.tasklist-dialog > .form-container {
  width: 80% !important;
  padding: 0;
  margin: 0;
}
.table-title {
  background-color: #f9f9f9;
  height: 40px;
  padding: 0px 20px;
  line-height: 40px;
  .left {
    display: flex;
    .redline {
      margin-top: 13px;
      margin-right: 10px;
      width: 2px;
      height: 14px;
      background-color: #e43552;
    }
    p {
      font-weight: 700;
    }
  }
}
</style>